package org.batyrov.equery.action.terminal;

import org.batyrov.equery.action.BaseAction;
import org.batyrov.equery.action.Const;
import org.batyrov.equery.bean.Client;
import org.batyrov.equery.kernel.*;

/**
 * Created by IntelliJ IDEA.
 * User: admin
 * Date: 25.07.2009
 * Time: 0:00:27
 * To change this template use File | Settings | File Templates.
 */
public class GetTicket extends BaseAction {
    private long serviceId = -1;
    private int clientNumber = -1;

    public int getClientNumber() {
        return clientNumber;
    }

    public void setClientNumber(int clientNumber){
        this.clientNumber = clientNumber;
    }

    public long getServiceId() {
        return serviceId;
    }

    public void setServiceId(long serviceId) {
        this.serviceId = serviceId;
    }

    @Override
    public String execute() throws Exception {
        super.execute();
        Client client = QueryManager.getQueryManager().getTicket(serviceId); //QueryManager..getTicket(serviceId);
        clientNumber = client.getNumber();
        return Const.SUCCESS;
    }
}
